package acwing.哈希;

import java.io.*;
import java.util.Scanner;

/**
 * 字符串哈希
 *
 * @author yang
 * @date 2021/11/23
 */
public class 字符串哈希 {

    static int N = 10010, P = 131;
    static int m, n;
    static long[] h = new long[N], p = new long[N];

    public static void main(String[] args) throws IOException {
        Scanner sy = new Scanner(System.in);

        //m为询问次数
        n = sy.nextInt();
        m = sy.nextInt();
        char[] a = (" " + sy.next()).toCharArray();
        p[0] = 1;
        for (int i = 1; i <= n; i++) {
            p[i] = p[i - 1] * P; // 预处理P的i次方
            h[i] = h[i - 1] * P + a[i]; // 字符前缀哈希
        }
        while (m-- != 0) {
            int l1 = sy.nextInt() , r1 = sy.nextInt();
            int l2 = sy.nextInt() , r2 = sy.nextInt();
            if(get(l1,r1) == get(l2,r2)) System.out.println("Yes");
            else System.out.println("No");
        }
    }
    public static long get(int l, int r) {
        // 计算出l~r 的哈希值
        return h[r] - h[l - 1] * p[r - l  + 1];
    }
}
